$:.unshift File.join(File.dirname(__FILE__))

#represents a dcop amarok call to whatever object is given as prefix
class Amarok
  def initialize prefix
    @prefix = prefix
  end
  def method_missing name, *args
    method_name = name.to_s.gsub(/_\w/) {|match| 
      match[-1..-1].upcase
    }

    argString = ""
    args.each {|arg| argString += " '#{arg}'"}

    cmd = "dcop amarok #{@prefix} #{method_name} #{argString}"

    response = `#{cmd}`
    response.chomp! if !response.nil?
    return response
  end
end
